package cn.sytton.taffe.file.service.impl;

import cn.sytton.taffe.file.entity.FileEntity;
import cn.sytton.taffe.file.mapper.FileMapper;
import cn.sytton.taffe.file.service.AbstractFileService;
import cn.sytton.taffe.file.service.MinioService;
import cn.sytton.taffe.file.service.IFileService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * 公共文件服务
 *
 * @author skyrock
 */
@Slf4j
@RequiredArgsConstructor
@Component
public class FileService extends AbstractFileService implements IFileService {

    private final MinioService minioService;
    private final FileMapper fileMapper;

    @Override
    public FileEntity uploadAndSave(MultipartFile file) {
        log.warn("公共FileService无法上传File");
        return null;
    }

    @Override
    public void afterPropertiesSet() {
        this.setMinioService(minioService);
        this.setFileMapper(fileMapper);
    }
}
